<html>
<head><meta charset="utf-8"><title>Uplift lints from clippy to rustc #53224 · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html">Uplift lints from clippy to rustc #53224</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="131239575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131239575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131239575">(Aug 10 2018 at 14:13)</a>:</h4>
<p>I was writing a long list of concerns before I realised that most of these can be quickly answered instead over chat</p>



<a name="131239623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131239623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131239623">(Aug 10 2018 at 14:14)</a>:</h4>
<p>@rfcbot concern false positives in eq_op?</p>
<blockquote>
<p>Checks for equal operands to comparison, logical and bitwise, difference and division binary operators (==, &gt;, etc., &amp;&amp;, ||, &amp;, |, ^, - and /).</p>
</blockquote>
<p><code>x ^ x</code> or <code>x - x</code> could be an easy way to get yourself a literal zero in generic code that otherwise already depends on <code>Sub</code> or <code>BitXor</code>, but does not have any other means of getting a zero yet.</p>



<a name="131239665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131239665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131239665">(Aug 10 2018 at 14:15)</a>:</h4>
<blockquote>
<p>concern unclear what level lints are aiming for by default</p>
</blockquote>
<hr>
<blockquote>
<p>deprecated_semver needs some help from cargo to weed out false positives for crates which are known to use non-semver versioning scheme</p>
</blockquote>
<hr>
<blockquote>
<p>concern logic_bug ignores short circuiting</p>
</blockquote>
<p>and related</p>
<blockquote>
<p>concern while_immutable_condition </p>
</blockquote>
<p>Does this work correctly with variables marked as <code>mut</code> and modified not by the body, but by the hardware?</p>
<p>E.g.</p>
<div class="codehilite"><pre><span></span>spi_peripheral_write(0x42);
// SPI_PERIPHERAL_STATE_REGISTER may be changed by the hardware.
while (SPI_PERIPHERAL_STATE_REGISTER &amp; READ_READY == 0) {
}
let read_byte = spi_peripheral_read();
</pre></div>



<a name="131239673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131239673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131239673">(Aug 10 2018 at 14:15)</a>:</h4>
<p>using <code>x ^ x</code> to get a "zero" where there isn't naturally a zero seems a bit hacky — there's no guarantee this has to be zero for custom traits</p>



<a name="131239725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131239725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131239725">(Aug 10 2018 at 14:16)</a>:</h4>
<p>mut_from_ref: This lint checks for functions that take immutable references and return mutable ones.</p>
<blockquote>
<p>This is trivially unsound</p>
</blockquote>
<p>Does this complain about (because this is not exactly unsound as long as <code>ensure_exclusivity</code> does what its name says.</p>
<div class="codehilite"><pre><span></span>unsafe fn foo(x: &amp;AtomicUsize) -&gt; &amp;mut u32 {
    static mut MY_STATIC: u32 = 0;
    ensure_exclusivity(x);
    &amp;mut MY_STATIC
}
</pre></div>



<a name="131239742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131239742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131239742">(Aug 10 2018 at 14:16)</a>:</h4>
<p>at the same time, this makes <code>x ^ x</code> not something you want to warn about, exactly because you don't have any guarantees</p>



<a name="131239777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131239777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131239777">(Aug 10 2018 at 14:17)</a>:</h4>
<p>it would be easy to check that the types are integers, I imagine</p>



<a name="131239891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131239891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131239891">(Aug 10 2018 at 14:19)</a>:</h4>
<p>seems reasonable for specific built-in types</p>



<a name="131239901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131239901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131239901">(Aug 10 2018 at 14:19)</a>:</h4>
<blockquote>
<p>at the same time, this makes <code>x ^ x</code> not something you want to warn about, exactly because you don't have any guarantees</p>
</blockquote>
<p>Yeah, you don’t want to lint against any of those in generic code, but it is unclear whether clippy takes care to check that, like for many other lints</p>



<a name="131239970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131239970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131239970">(Aug 10 2018 at 14:20)</a>:</h4>
<p>the clippy descriptions are very concise and not at all appropriate for making decisions like whether the lint should be included into the compiler</p>



<a name="131239981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131239981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131239981">(Aug 10 2018 at 14:20)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="124288">@Oli</span> ^</p>



<a name="131240126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240126">(Aug 10 2018 at 14:23)</a>:</h4>
<p>it'd be nice to have clippy support on the playground to test these things out directly</p>



<a name="131240198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240198">(Aug 10 2018 at 14:24)</a>:</h4>
<blockquote>
<p>it'd be nice to have clippy support on the playground to test these things out directly</p>
</blockquote>
<p>Oh there is!</p>



<a name="131240200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240200">(Aug 10 2018 at 14:24)</a>:</h4>
<p>on the right hand side there’s a "Tools" dropdown</p>



<a name="131240208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240208">(Aug 10 2018 at 14:24)</a>:</h4>
<p>and in it there’s clippy. I absolutely forgot about that</p>



<a name="131240307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240307">(Aug 10 2018 at 14:26)</a>:</h4>
<p>Well, the <code>mut_from_ref</code> definitely fails my test.</p>



<a name="131240392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240392">(Aug 10 2018 at 14:27)</a>:</h4>
<p>I do feel like some very minimal amount of false positives are ok —</p>



<a name="131240399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240399">(Aug 10 2018 at 14:27)</a>:</h4>
<p>not sure which of your examples meets that test</p>



<a name="131240402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240402">(Aug 10 2018 at 14:27)</a>:</h4>
<p>but if you are doing something very subtle</p>



<a name="131240415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240415">(Aug 10 2018 at 14:27)</a>:</h4>
<p>to my mind, it is ok to <code>#[allow()]</code> a lint — good place to leave a comment :)</p>



<a name="131240426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240426">(Aug 10 2018 at 14:28)</a>:</h4>
<p>basically that's kind of my rule</p>



<a name="131240485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240485">(Aug 10 2018 at 14:28)</a>:</h4>
<p>if I wrote that code, would I also write a comment like <code>// Subtle: ...</code>?</p>



<a name="131240493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240493">(Aug 10 2018 at 14:28)</a>:</h4>
<p>if so, a lint makes sense, since it reminds me to write the comment :)</p>



<a name="131240559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240559">(Aug 10 2018 at 14:30)</a>:</h4>
<p>well, neither of my examples are subtle, but rather something that you wouldn’t really do on your usual hosted platform</p>



<a name="131240687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240687">(Aug 10 2018 at 14:31)</a>:</h4>
<p>some of the lints seem to be fairly opionated on how exactly a platform should work. We could allow-by-default these lints on platforms which do not adhere to the opinions though.</p>



<a name="131240792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240792">(Aug 10 2018 at 14:32)</a>:</h4>
<p>I consider </p>
<div class="codehilite"><pre><span></span><span class="k">unsafe</span><span class="w"> </span><span class="k">fn</span> <span class="nf">foo</span><span class="p">(</span><span class="n">x</span>: <span class="kp">&amp;</span><span class="nc">AtomicUsize</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="nc">mut</span><span class="w"> </span><span class="kt">u32</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">static</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">MY_STATIC</span>: <span class="kt">u32</span> <span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="n">ensure_exclusivity</span><span class="p">(</span><span class="n">x</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">MY_STATIC</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>somewhat subtle.</p>



<a name="131240818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240818">(Aug 10 2018 at 14:32)</a>:</h4>
<p>I'm not convinced it even makes sense -- when/how does the "lock" from <code>ensure_exclusivity</code> get released?</p>



<a name="131240867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240867">(Aug 10 2018 at 14:33)</a>:</h4>
<p>I would write such code (well, with some additional linkage attributes) on a bare metal program in a blink of an eye</p>



<a name="131240880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240880">(Aug 10 2018 at 14:33)</a>:</h4>
<p>and you ought to comment it =)</p>



<a name="131240895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240895">(Aug 10 2018 at 14:33)</a>:</h4>
<p>but yes I might be overlooking the platform specifics or something, I don't know</p>



<a name="131240978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/131240978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#131240978">(Aug 10 2018 at 14:34)</a>:</h4>
<p>in general I agree that compiler should be conservative when it comes to false positive..</p>



<a name="132033972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/132033972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#132033972">(Aug 13 2018 at 09:10)</a>:</h4>
<p>I'm absolutely fine with making this a hosted-platform-only lint. I didn't consider embedded at all for this.</p>



<a name="132034270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Uplift%20lints%20from%20clippy%20to%20rustc%20%2353224/near/132034270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Uplift.20lints.20from.20clippy.20to.20rustc.20.2353224.html#132034270">(Aug 13 2018 at 09:16)</a>:</h4>
<p>wrt eq_op: we can totally ignore it if the args are of a generic type for value computing operators. I don't think comparison operators are problematic like this. While <code>x == x</code> can be false (for e.g. floats), there are definitely better ways to check constraints</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>